package com.example.springboot01.aware;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

/**
 * @Description : 类描述
 * Created by cyd on 2021-05-03 09:13:37
 */
public class TestMain {
    public static void main(String[] args) throws IOException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AwareConfig.class);
        AwareService bean = context.getBean(AwareService.class);
        bean.outPutResult();
        test(context);
        context.close();
    }

    private static void test(AnnotationConfigApplicationContext context) {
        AwareService2 bean = context.getBean(AwareService2.class);
        bean.useAppContext();
    }


}
